package cn.appsys.pojo;

import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * Created by Super Cui on 2017/10/12.
 */
public class DevUser implements Serializable {
    private Long id;
    private String devCode;
    private String devName;
    private String devPassword;
    private String devEmail;
    private String devInfo;
    private Long createdBy;
    @DateTimeFormat
    private Date creationDate;
    private Long modifyBy;
    @DateTimeFormat
    private Date modifyDate;

    /**
     * constructor
     */
    public DevUser() {
    }

    /**
     * constructor
     * @param id
     */
    public DevUser(Long id) {
        this.id = id;
    }

    /**
     * constructor
     * @param devCode
     * @param devPassword
     */
    public DevUser(String devCode, String devPassword) {
        this.devCode = devCode;
        this.devPassword = devPassword;
    }

    /**
     * constructor
     * @param id
     * @param devCode
     * @param devName
     * @param devPassword
     * @param devEmail
     * @param devInfo
     * @param createdBy
     * @param creationDate
     * @param modifyBy
     * @param modifyDate
     */
    public DevUser(Long id, String devCode, String devName, String devPassword, String devEmail, String devInfo, Long createdBy, Date creationDate, Long modifyBy, Date modifyDate) {
        this.id = id;
        this.devCode = devCode;
        this.devName = devName;
        this.devPassword = devPassword;
        this.devEmail = devEmail;
        this.devInfo = devInfo;
        this.createdBy = createdBy;
        this.creationDate = creationDate;
        this.modifyBy = modifyBy;
        this.modifyDate = modifyDate;
    }

    @Override
    public String toString() {
        return "DevUser{" +
                "id=" + id +
                ", devCode='" + devCode + '\'' +
                ", devName='" + devName + '\'' +
                ", devPassword='" + devPassword + '\'' +
                ", devEmail='" + devEmail + '\'' +
                ", devInfo='" + devInfo + '\'' +
                ", createdBy=" + createdBy +
                ", creationDate=" + ((creationDate != null) ? (new SimpleDateFormat("yyyy-MM-dd").format(creationDate)) : "") +
                ", modifyBy=" + modifyBy +
                ", modifyDate=" + ((modifyDate != null) ? (new SimpleDateFormat("yyyy-MM-dd").format(modifyDate)) : "") +
                '}';
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getDevCode() {
        return devCode;
    }

    public void setDevCode(String devCode) {
        this.devCode = devCode;
    }

    public String getDevName() {
        return devName;
    }

    public void setDevName(String devName) {
        this.devName = devName;
    }

    public String getDevPassword() {
        return devPassword;
    }

    public void setDevPassword(String devPassword) {
        this.devPassword = devPassword;
    }

    public String getDevEmail() {
        return devEmail;
    }

    public void setDevEmail(String devEmail) {
        this.devEmail = devEmail;
    }

    public String getDevInfo() {
        return devInfo;
    }

    public void setDevInfo(String devInfo) {
        this.devInfo = devInfo;
    }

    public Long getCreatedBy() {
        return createdBy;
    }

    public void setCreatedBy(Long createdBy) {
        this.createdBy = createdBy;
    }

    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }

    public Long getModifyBy() {
        return modifyBy;
    }

    public void setModifyBy(Long modifyBy) {
        this.modifyBy = modifyBy;
    }

    public Date getModifyDate() {
        return modifyDate;
    }

    public void setModifyDate(Date modifyDate) {
        this.modifyDate = modifyDate;
    }
}
